package com.bing.java.thread.exception;

/**
 * 
 * @author bing
 *
 * 2019年11月9日 上午10:04:19
 * 不调用interrupt死循环
 */
public class InterruptExample2 {

	private static class MyThread2 extends Thread {
		@Override
		public void run() {
			while (!interrupted()) {
				// ..
				System.out.println("xunhuan");
			}
			System.out.println("Thread end");
		}
	}

	public static void main(String[] args) throws InterruptedException {
		Thread thread2 = new MyThread2();
		thread2.start();
//		thread2.interrupt();
	}
}
